from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from Apis.serializers import ProductModelSerializer
from product.models import Product

class ListModelMixin(GenericAPIView):
    queryset = Product.objects.all()
    serializer_class = ProductModelSerializer

    def list(self, requets):
        queryset = self.get_queryset()
        ser = self.get_serializer(queryset, many=True)
        return Response({"message": "ok", "data": ser.data}, status=200)
    